<table>
  <tr>
    <th>Name</th>
    <th>Type</th>
    <th>Start</th>
    <th>End</th>
    <th>Approved</th>

    <% if display == "creator" %>
      <th>Creator</th>
    <% else %>
      <th>Owner</th>
    <% end %>

  </tr>

<% events.each do |event| %>
  <tr>
    <td><%= link_to event.name, event %></td>
    <td><%= Event::TYPE_NAMES[event.event_type] %></td>
    <td><%= event.start_at.to_formatted_s(:short) %></td>
    <td><%= event.end_at.to_formatted_s(:short) %></td>
    <td><%  display_true_false_field(event.approved) %></td>

    <% if display == "creator" %>
      <td><%= link_to event.creator.username, event.creator %></td>
    <% else %>
      <td><%= link_to event.owner.username, event.owner %></td>
    <% end %>

  </tr>
<% end %>
</table>
